const test_conf = require('./test_conf');
const CopyWebpackPlugin = require('copy-webpack-plugin');

function env_define(env, argv, config, cdn_modules) {
    if (env && env['self_define_value']) {
        console.log('has self define value [' + env['self_define_value'] + "].");
    }
    test_conf.print_build_msg(argv, config, cdn_modules);
    if (env && env['copy_static']) {
        console.log('has copy_static define [' + env['copy_static'] + "].");
        config.plugins.push(new CopyWebpackPlugin([
            {
                from: __dirname + '/../image',
                to: __dirname + '/../dist/image'
            }
        ]));
    }
}

module.exports = {
    env_define,
};